package com.www.applyword.ui.home;

import android.util.DisplayMetrics;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.widget.TextView;

import com.www.applyword.Constants.Constants;
import com.www.applyword.R;
import com.www.applyword.base.BaseActivity;
import com.www.applyword.bean.WXPayBean;
import com.www.applyword.http.CallBack;
import com.www.applyword.http.HttpClient;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;

import butterknife.BindView;

/**
 * author : huang
 * date   : 2019/11/25 0025 17:57
 * version: 1.0
 */
public class AgreementActivity extends BaseActivity {

    @BindView(R.id.webview)
    WebView webview;
    @BindView(R.id.tv)
    TextView tv;
    private int type;



    @Override
    protected void loadViewLayout() {
        setContentView(R.layout.agreement_activity);
        type = getIntent().getIntExtra("type", 0);
        if (type == 1) {
            setTitle("发布招聘协议");
        } else {
            setTitle("注册用户协议");
        }
        initView();
    }

    private void initView() {

        InputStream input= getResources().openRawResource(R.raw.helper);//xiaohuat是我的文件名，这里应该根据具体文件更改
        //  Reader reader = new InputStreamReader(input);
        InputStreamReader reader = null;   //指定格式
        BufferedReader br = null;   //指定格式
        String s = "";
        try {
            reader = new InputStreamReader(input,"GBK");
            // reader = new InputStreamReader(input);
            br = new BufferedReader(reader);
            String temp = "";
            while ((temp = br.readLine()) != null) {
                temp += "\n";
                s = s + temp;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        tv.setText(s);
}

    @Override
    protected void loadData() {

    }
}
